package net.sky.oa.dao.talkpark.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import net.sky.oa.dao.SkyBaseDaoImpl;
import net.sky.oa.dao.talkpark.TalBoxUserDao;
import net.sky.oa.model.TalBoxUser;

@SuppressWarnings("unchecked")
@Repository
public class TalBoxUserDaoImpl extends SkyBaseDaoImpl<TalBoxUser> implements
		TalBoxUserDao {
	
	public TalBoxUserDaoImpl(){
		super.setPersistType(TalBoxUser.class);
	}

	public List<TalBoxUser> findAllTalboxUser() {
		
	   String hql="from TalBoxUser tbu";
		return findByHql(hql);
	}
	
	public List<TalBoxUser> findTalboxUserId(Long boxId,Long userId){
		String hql="from TalBoxUser tbu where tbu.box.id=? and tbu.user.id=?";
	    return findByHql(hql,new Object[]{boxId,userId});
	}


}
